﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace DemoWS
{
    public partial class WebForm2 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btn_KetQua_Click(object sender, EventArgs e)
        {
            
            //khai bao doi tuong web service
            TinhToan objser = new TinhToan();

            string kq = "";
            int so1 = int.Parse(txt_So1.Text);
            int so2 = int.Parse(txt_So2.Text);
            switch (ddl_pheptoan.SelectedValue)
            {
                case "cong":
                    kq = objser.cong(so1, so2).ToString();
                    break;
                case "tru":
                    kq = objser.tru(so1, so2).ToString();
                    break;
                case "nhan":
                    kq = objser.nhan(so1, so2).ToString();
                    break;
                case "chia":
                    kq = objser.chia(so1, so2).ToString();
                    break;
            }
            txt_KetQua.Text = "Ket qua: " + kq;
        }
        
    }
}